$("#login").click(function(){
  var html = '<form class="layui-form" style="padding-right:20px;padding-top:20px;" id="loginForm">'+
              '<div class="layui-form-item">'+
              '  <label class="layui-form-label">用户名</label>'+
              '  <div class="layui-input-block">'+
              '    <input type="text" style="width:200px" name="username" required value="admin"  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">'+
              '  </div>'+
              '</div>'+
              '<div class="layui-form-item">'+
              '  <label class="layui-form-label">密码框</label>'+
              '  <div class="layui-input-inline">'+
              '    <input type="password" style="width:200px" name="password" required value="123456" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">'+
              '  </div>'+
              '</div>'+
            '</form>'
  layer.open({
      type:1,
      title:"登录",
      content:html,
      btn:['登录'],
      yes: function(index, layero){
          //按钮【按钮一】的回调
          var userName = $("#loginForm").find("[name='username']").val();
          var password = $("#loginForm").find("[name='password']").val();
          CommonUtil.axiosWithServerName('post',
                  '/magical_lowcode/server/web/login',
                  {userName:userName,password:password},
                  function(res){
                      layer.close(index);
                      layer.msg("登录成功,可以发布组件啦")
                  }
          )
       }
  })
})
